/*@license_header@*/
package io.ticup.rad.dbs.config;

import io.ticup.rad.dbs.core.DynamicDataSource;
import io.ticup.rad.dbs.core.aop.MultiSourceExAop;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * 多数据源druid配置
 *
 * @author xuyuxiang
 * @date 2020/8/24
 */
@Configuration
@Import(DataSourcePropertiesConfig.class)
public class MultiDataSourceConfig {

    /**
     * 多数据源的连接池
     *
     * @author xuyuxiang
     * @date 2020/8/25
     */
    @Bean
    public DynamicDataSource dataSource() {
        return new DynamicDataSource();
    }

    /**
     * 数据源切换的AOP
     *
     * @author xuyuxiang
     * @date 2020/8/25
     */
    @Bean
    public MultiSourceExAop multiSourceExAop() {
        return new MultiSourceExAop();
    }

}
